<%@ include file="/header.jsp" %>

<h1>Grant/Revoke Rights</h1>

<c:if test="${not empty sessionScope._user && sessionScope._user.isAdmin eq 'Y'}">
<form:form commandName="grant_revoke">
    <p><label for="userName">Login</label><br/>
    <form:input path="userName" disabled="true"/>
    <form:errors path="userName" cssStyle="color: red"/>
    </p>
    <p><label for="isAdmin">Admin option</label><br/>
    <c:choose>
    <c:when test="${grant_revoke.isAdmin} eq 'Y'">
    <c:set var="admval" value="N" />
    </c:when>
    <c:otherwise>
    <c:set var="admval" value="Y" />
    </c:otherwise>
    </c:choose>
    <form:checkbox path="isAdmin"  value="${admval}"/>

    <form:errors path="isAdmin" cssStyle="color: red"/>
    </p>
    <p><input type="submit" value="Save"/>
</form:form>
    
</c:if>

<%@ include file="/footer.jsp" %>
</html>
